package org.intellij.doctree.node;

import com.intellij.openapi.application.PathManager;

import java.io.Serializable;

public class Document implements Serializable {

    protected String url;
    protected String name;
    protected String description;

    public Document() {
    }

    public Document(String url, String name, String description) {
        this.url = url;
        this.name = name;
        this.description = description;
    }

    public String getURL() {
        return url;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public String toString() {
        return name;
    }

    public static String expandMacros(String value) {
        if (value == null || value.length() == 0) return "";
        String ideaHome = PathManager.getHomePath();
        return value.replace("{idea.home.path}", ideaHome);
    }

}
